package com.mrzhou.user.feign;

import com.mrzhou.common.entity.system.UserInfo;
import com.mrzhou.common.feign.client.IUserClient;
import com.mrzhou.core.tool.api.R;
import com.mrzhou.user.service.IUserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@AllArgsConstructor
public class UserClient implements IUserClient {

    private IUserService userService;

    @Override
    @GetMapping(USER_INFO)
    public R<UserInfo> userInfo(String username) {
        return userService.userInfo(username);
    }

    @Override
    @GetMapping(USER_INFO_BY_ID)
    public R<UserInfo> userInfoById(@RequestParam Long userId) {
        return userService.userInfoById(userId);
    }

}
